<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="if (top.frames['componentsframe'] == undefined) { s = window.location.toString(); window.location = 'index.html?p=' + s.substring(s.lastIndexOf('/')+1); }">
<h2 class="comptitle">Simple Module <i>BasePhyLayer</i></h2>
<b>Package:</b> org.mixim.base.phyLayer<br/><b>File: <a href="src-base-phyLayer-BasePhyLayer.ned.html">src/base/phyLayer/BasePhyLayer.ned</a></b><br/><p><a href="../doxy/a00029.html" target="mainframe"><b>C++ definition</b></a></p>

<p>Basic physical layer module.
See the class "<a href="org.mixim.base.phyLayer.BasePhyLayer.html">BasePhyLayer</a>" documentation.</p>
<img src="org.mixim.base.phyLayer.BasePhyLayer-type.png" ismap="yes" usemap="#type-diagram"/><map name="type-diagram">
<area shape="rect" href="org.mixim.base.phyLayer.BasePhyLayer.html" title="BasePhyLayer" alt="BasePhyLayer" coords="0,30,118,70">
</map>
<h3 class="subtitle">Usage diagram:</h3>
<p>The following diagram shows usage relationships between types.
Unresolved types are missing from the diagram. Click <a href="full-ned-usage-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.base.phyLayer.BasePhyLayer-usage.png" ismap="yes" usemap="#usage-diagram"/><map name="usage-diagram"><area shape="rect" href="org.mixim.base.phyLayer.BasePhyLayer.html" title="Simple Module BasePhyLayer" alt="BasePhyLayer" coords="7,16,103,40">
</map>
<h3 class="subtitle">Inheritance diagram:</h3>
<p>The following diagram shows inheritance relationships for this type.
Unresolved types are missing from the diagram. Click <a href="full-ned-inheritance-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.base.phyLayer.BasePhyLayer-inheritance.png" ismap="yes" usemap="#inheritance-diagram"/><map name="inheritance-diagram"><area shape="rect" href="org.mixim.base.phyLayer.BasePhyLayer.html" title="Simple Module BasePhyLayer" alt="BasePhyLayer" coords="109,88,205,112">
<area shape="rect" href="org.mixim.modules.phy.PhyLayer.html" title="Simple Module PhyLayer" alt="PhyLayer" coords="7,160,79,184">
<area shape="rect" href="org.mixim.modules.phy.PhyLayerUWBIR.html" title="Simple Module PhyLayerUWBIR" alt="PhyLayerUWBIR" coords="103,160,212,184">
<area shape="rect" href="org.mixim.examples.analogueModels.SamplePhyLayer.html" title="Simple Module SamplePhyLayer" alt="SamplePhyLayer" coords="236,160,345,184">
<area shape="rect" href="org.mixim.base.phyLayer.IWirelessPhy.html" title="Module Interface IWirelessPhy" alt="IWirelessPhy" coords="113,16,201,40">
</map>
<h3 class="subtitle">Known subclasses:</h3>
<table class="typestable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Type</th>
      <th class="description">Description</th>
   </tr>
<tr>
   <td>
<a href="org.mixim.modules.phy.PhyLayer.html">PhyLayer</a>
   </td>
   <td>
<i>simple&nbsp;module</i>
   </td>
   <td>

<p>Physical layer module which knows how to initialize the Deciders
and <a href="org.mixim.examples.analogueModels.AnalogueModels.html">AnalogueModels</a> from the modules directory.
See the classes documentation for details.</p>

   </td>
</tr>
<tr>
   <td>
<a href="org.mixim.modules.phy.PhyLayerUWBIR.html">PhyLayerUWBIR</a>
   </td>
   <td>
<i>simple&nbsp;module</i>
   </td>
   <td>

<p>A physical layer that models an Ultra Wideband Impulse Radio wireless communication system.</p>

   </td>
</tr>
<tr>
   <td>
<a href="org.mixim.examples.analogueModels.SamplePhyLayer.html">SamplePhyLayer</a>
   </td>
   <td>
<i>simple&nbsp;module</i>
   </td>
   <td>
<i>(no description)</i>
   </td>
</tr>
</table>
<h3 class="subtitle">Parameters:</h3>
<table class="paramstable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Type</th>
      <th class="defaultvalue">Default value</th>
      <th class="description">Description</th>
   </tr>
<tr class="local">
   <td>coreDebug</td>
   <td>
      <i>bool</i>
   </td>
   <td>false</td>
   <td>
<p>debug switch for core framework</p>
   </td>
</tr>
<tr class="local">
   <td>recordStats</td>
   <td>
      <i>bool</i>
   </td>
   <td>false</td>
   <td>
<p>enable/disable tracking of statistics (eg. cOutvectors)</p>
   </td>
</tr>
<tr class="local">
   <td>headerLength</td>
   <td>
      <i>int</i>
   </td>
   <td>0</td>
   <td>
<p>defines the length of the phy header (/preamble)</p>
   </td>
</tr>
<tr class="local">
   <td>usePropagationDelay</td>
   <td>
      <i>bool</i>
   </td>
   <td></td>
   <td>
<p>Should transmission delay be simulated?</p>
   </td>
</tr>
<tr class="local">
   <td>thermalNoise</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>the strength of the thermal noise [dBm]</p>
   </td>
</tr>
<tr class="local">
   <td>useThermalNoise</td>
   <td>
      <i>bool</i>
   </td>
   <td></td>
   <td>
<p>should thermal noise be considered?</p>
   </td>
</tr>
<tr class="local">
   <td>analogueModels</td>
   <td>
      <i>xml</i>
   </td>
   <td></td>
   <td>
<p>Specification of the analogue models to use and their parameters</p>
   </td>
</tr>
<tr class="local">
   <td>decider</td>
   <td>
      <i>xml</i>
   </td>
   <td></td>
   <td>
<p>Specification of the decider to use and its parameters</p>
   </td>
</tr>
<tr class="local">
   <td>sensitivity</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>The sensitivity of the physical layer [dBm]</p>
   </td>
</tr>
<tr class="local">
   <td>maxTXPower</td>
   <td>
      <i>double</i>
   </td>
   <td></td>
   <td>
<p>The maximum transimission power of the physical layer [mW]</p>
   </td>
</tr>
<tr class="local">
   <td>timeRXToTX</td>
   <td>
      <i>double</i>
   </td>
   <td>0</td>
   <td>
   </td>
</tr>
<tr class="local">
   <td>timeRXToSleep</td>
   <td>
      <i>double</i>
   </td>
   <td>0</td>
   <td>
<p>Elapsed time to switch from receive to sleep state</p>
   </td>
</tr>
<tr class="local">
   <td>timeTXToRX</td>
   <td>
      <i>double</i>
   </td>
   <td>0</td>
   <td>
<p>Elapsed time to switch from send to receive state</p>
   </td>
</tr>
<tr class="local">
   <td>timeTXToSleep</td>
   <td>
      <i>double</i>
   </td>
   <td>0</td>
   <td>
<p>Elapsed time to switch from send to sleep state</p>
   </td>
</tr>
<tr class="local">
   <td>timeSleepToRX</td>
   <td>
      <i>double</i>
   </td>
   <td>0</td>
   <td>
<p>Elapsed time to switch from sleep to receive state</p>
   </td>
</tr>
<tr class="local">
   <td>timeSleepToTX</td>
   <td>
      <i>double</i>
   </td>
   <td>0</td>
   <td>
<p>Elapsed time to switch from sleep to send state</p>
   </td>
</tr>
<tr class="local">
   <td>initialRadioState</td>
   <td>
      <i>int</i>
   </td>
   <td>0</td>
   <td>
<p>State the radio is initially in (0=RX, 1=TX, 2=Sleep)</p>
   </td>
</tr>
<tr class="local">
   <td>radioMinAtt</td>
   <td>
      <i>double</i>
   </td>
   <td>1.0</td>
   <td>
<p>radios gain factor (attenuation) while receiving</p>
   </td>
</tr>
<tr class="local">
   <td>radioMaxAtt</td>
   <td>
      <i>double</i>
   </td>
   <td>0.0</td>
   <td>
<p>radios gain factor (attenuation) while not receiving</p>
   </td>
</tr>
<tr class="local">
   <td>nbRadioChannels</td>
   <td>
      <i>int</i>
   </td>
   <td>1</td>
   <td>
<p>Number of available radio channels. Defaults to single channel radio.</p>
   </td>
</tr>
<tr class="local">
   <td>initialRadioChannel</td>
   <td>
      <i>int</i>
   </td>
   <td>0</td>
   <td>
<p>Initial radio channel.</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Gates:</h3>
<table class="gatestable">
   <tr>
      <th class="name">Name</th>
      <th class="type">Direction</th>
      <th class="gatesize">Size</th>
      <th class="description">Description</th>
   </tr>
<tr class="local">
   <td>upperLayerIn</xsl:if></td>
   <td><i>input</i></td>
   <td></td>   <td>
<p>from the MAC layer</p>
</td>
</tr>
<tr class="local">
   <td>upperLayerOut</xsl:if></td>
   <td><i>output</i></td>
   <td></td>   <td>
<p>to the MAC layer</p>
</td>
</tr>
<tr class="local">
   <td>upperControlIn</xsl:if></td>
   <td><i>input</i></td>
   <td></td>   <td>
<p>control from the MAC layer</p>
</td>
</tr>
<tr class="local">
   <td>upperControlOut</xsl:if></td>
   <td><i>output</i></td>
   <td></td>   <td>
<p>control to the MAC layer</p>
</td>
</tr>
<tr class="local">
   <td>radioIn</xsl:if></td>
   <td><i>input</i></td>
   <td></td>   <td>
<p>for sendDirect from other physical layers</p>
</td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #808080; font-style: italic; ">// Basic physical layer module.
// See the class &quot;BasePhyLayer&quot; documentation.
</span><span style="color: #800000; font-weight: bold; ">simple</span><span style="color: #000000; "> </span><span style="color: #000000; ">BasePhyLayer</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">like</span><span style="color: #000000; "> </span><span style="color: #000000; ">IWirelessPhy</span><span style="color: #000000; ">
{
    </span><span style="color: #800000; font-weight: bold; ">parameters</span><span style="color: #000000; ">:
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">coreDebug</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">//debug switch for core framework
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">recordStats</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">false</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">//enable/disable tracking of statistics (eg. cOutvectors)
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">headerLength</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">bit</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">//defines the length of the phy header (/preamble)
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">usePropagationDelay</span><span style="color: #000000; ">;		</span><span style="color: #808080; font-style: italic; ">//Should transmission delay be simulated?
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">thermalNoise</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">dBm</span><span style="color: #000000; ">);	</span><span style="color: #808080; font-style: italic; ">//the strength of the thermal noise [dBm]
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">useThermalNoise</span><span style="color: #000000; ">;			</span><span style="color: #808080; font-style: italic; ">//should thermal noise be considered?
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">xml</span><span style="color: #000000; "> </span><span style="color: #000000; ">analogueModels</span><span style="color: #000000; ">; 			</span><span style="color: #808080; font-style: italic; ">//Specification of the analogue models to use and their parameters
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">xml</span><span style="color: #000000; "> </span><span style="color: #000000; ">decider</span><span style="color: #000000; ">;					</span><span style="color: #808080; font-style: italic; ">//Specification of the decider to use and its parameters
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">sensitivity</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">dBm</span><span style="color: #000000; ">);	</span><span style="color: #808080; font-style: italic; ">//The sensitivity of the physical layer [dBm]
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">maxTXPower</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">mW</span><span style="color: #000000; ">);	</span><span style="color: #808080; font-style: italic; ">//The maximum transimission power of the physical layer [mW]
</span><span style="color: #000000; ">
        </span><span style="color: #0000ff; font-style: italic; ">//# switch times [s]:
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeRXToTX</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// Elapsed time to switch from receive to send state
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeRXToSleep</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// Elapsed time to switch from receive to sleep state
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeTXToRX</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// Elapsed time to switch from send to receive state
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeTXToSleep</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// Elapsed time to switch from send to sleep state
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeSleepToRX</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// Elapsed time to switch from sleep to receive state
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">timeSleepToTX</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// Elapsed time to switch from sleep to send state
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">initialRadioState</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">);   </span><span style="color: #808080; font-style: italic; ">// State the radio is initially in (0=RX, 1=TX, 2=Sleep) 
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">radioMinAtt</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">1</span><span style="color: #000000; ">.</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">//radios gain factor (attenuation) while receiving
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">radioMaxAtt</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">.</span><span style="color: #008000; ">0</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">//radios gain factor (attenuation) while not receiving
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">nbRadioChannels</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">1</span><span style="color: #000000; ">);  </span><span style="color: #808080; font-style: italic; ">// Number of available radio channels. Defaults to single channel radio.
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">initialRadioChannel</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">0</span><span style="color: #000000; ">);  </span><span style="color: #808080; font-style: italic; ">// Initial radio channel.
</span><span style="color: #000000; ">
    </span><span style="color: #800000; font-weight: bold; ">gates</span><span style="color: #000000; ">:
        </span><span style="color: #000080; font-weight: bold; ">input</span><span style="color: #000000; "> </span><span style="color: #000000; ">upperLayerIn</span><span style="color: #000000; ">; 	</span><span style="color: #808080; font-style: italic; ">// from the MAC layer
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">output</span><span style="color: #000000; "> </span><span style="color: #000000; ">upperLayerOut</span><span style="color: #000000; ">; 	</span><span style="color: #808080; font-style: italic; ">// to the MAC layer
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">input</span><span style="color: #000000; "> </span><span style="color: #000000; ">upperControlIn</span><span style="color: #000000; ">; 	</span><span style="color: #808080; font-style: italic; ">// control from the MAC layer        
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">output</span><span style="color: #000000; "> </span><span style="color: #000000; ">upperControlOut</span><span style="color: #000000; ">; 	</span><span style="color: #808080; font-style: italic; ">// control to the MAC layer
</span><span style="color: #000000; ">
        </span><span style="color: #000080; font-weight: bold; ">input</span><span style="color: #000000; "> </span><span style="color: #000000; ">radioIn</span><span style="color: #000000; ">; </span><span style="color: #808080; font-style: italic; ">// for sendDirect from other physical layers
</span><span style="color: #000000; ">
}

</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
